@extends('common.admin-master')

@section('html-body')
    <div class="content">

        <div class="header">
            <div class="stats">
                <p class="stat"><a href="{{route('Admin')}}">返回首页</a></p>
            </div>
            <h1 class="page-title">审核管理</h1>
        </div>

        <div class="container-fluid">
            <div class="row-fluid">

                <div class="row-fluid">
                    <div class="block span12">
                        <a href="#tablewidget" class="block-heading" data-toggle="collapse">审核投资人列表<span class="label
                        label-warning">+10</span></a>
                        <div id="tablewidget" class="block-body collapse in">
                            <table class="table">
                                <thead>
                                <tr>
                                    <th>姓名</th>
                                    <th>投资领域</th>
                                    <th>投资阶段</th>
                                    <th>所属投资机构</th>
                                    <th>投资金额范围</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                @if($investors)
                                    @foreach($investors as $investor)
                                       @if($user = $investor->toUser)
                                       @if($userInfo =$investor->toUser->userInfo)
                                <tr>
                                    <td>{{$userInfo->realname}}</td>
                                    <td>
                                        @if($fields = $investor->investor_x_fields)
                                        @foreach($fields as $field)
                                            {{$field->field}}<br/>
                                        @endforeach
                                        @endif
                                    </td>
                                    <td>
                                        @if($phases = $investor->investor_x_phases)
                                        @foreach($phases as $phase)
                                            {{$phase->phase}}
                                        @endforeach
                                        @endif
                                    </td>
                                    <td>
                                        @if($org = $investor->toInvestOrg)
                                            {{$org->invest_name}}
                                        @endif
                                    </td>
                                    <td>
                                        @if($min_money=$investor->invest_num_small && $max_money=$investor->invest_num_big)
                                            {{$min_money}}—{{$max_money}}万
                                        @else
                                            暂无数据
                                        @endif
                                    </td>
                                    @if($investor->status == 1)
                                        <td class="success">审核通过</td>
                                    @elseif($investor->status == -2)
                                        <td class="warning">审核未通过</td>
                                    @else
                                        <td>
                                            <button type="button" class="btn btn-info investor_over" data="{{$investor->id}}">审核通过</button>
                                            <button type="button" class="btn  investor_out" data="{{$investor->id}}">审核未通过</button>
                                        </td>
                                    @endif

                                </tr>
                                        @endif
                                        @endif
                                    @endforeach
                                @endif
                                </tbody>
                            </table>
                        </div>
                        <div class="pagination">
                            <ul>
                                {!! $investors->render() !!}
                            </ul>
                        </div>
                    </div>

                </div>

            </div>
        </div>
    </div>

    <script>
        var CheckOverInvestor   = "{{route('Api.Admin.CheckOverInvestor' ,['id'=>1])}}";
        var CheckOutInvestor   = "{{route('Api.Admin.CheckOutInvestor' , ['id'=>-2])}}";
    </script>
    <script src="{{url('/js/admin/check.js')}}"></script>

    <script type="text/javascript">
        $("[rel=tooltip]").tooltip();
        $(function() {
            $('.demo-cancel-click').click(function(){return false;});
        });

        $('#nav_tab a').click(function (e) {
            e.preventDefault();
            $(this).tab('show');
        })

    </script>

@endsection


